import { NavBar } from 'antd-mobile'
import React, { useEffect, useState } from 'react'
import { useNavigate, useParams } from 'react-router-dom'
import styles from './css/index.module.css'
import request from '../../../api/request'
function Index() {
    const navigate=useNavigate()
    const {infoId}=useParams()

    const [data,setData]=useState([])
    useEffect(()=>{
        request.get('/share/information/v1/findInformation',{
            params:{
                infoId:infoId
            }
        }).then((res)=>{
            console.log(res);
            setData(res.data.result)
        })
    },[infoId])

  return (
    <div className={styles.box}>
      <NavBar className={styles.header} onBack={()=>navigate(-1)}>咨询详情</NavBar>
        {/* 将 data.content 中的字符串解析为 HTML 代码，并直接渲染到页面上 */}
        <div dangerouslySetInnerHTML={{ __html: data.content }} ></div>
            
            
        
    </div>
  )
}

export default Index
